<template>
  <div>
    <!-- <h3>{{companyName}}</h3>
      <p>问题描述:</p>
      <p>该公司门禁系统上报信息与真实信息不符。</p>
      <p>操作:</p>
        <div class="btns">
            <van-button type="primary" size="mini">情况属实</van-button>
            <van-button type="primary" size="mini">情况属实</van-button>
    </div>-->
    <van-cell-group>
      <van-field label="企业名称" :value="problemData.enterpriseName" readonly />
      <van-field label="企业信用代码" :value="problemData.enterpriseCode" readonly />
      <van-field label="园区名称" :value="problemData.parkName||'园区外'" readonly />
      <van-field label="注册地址" type="textarea" autosize :value="problemData.registeredAddress" readonly />
      <!-- <van-field
        label="问题类型"
        :value="problemData.type=='wtlx-wtlx1-ej'?'问题类型1':problemData.type=='wtlx-wtlx2-ej'?'问题类型2':'问题类型3'"
        readonly
      /> -->
      <van-field
        label="问题类型"
        :value="wentileixin"
        readonly
      />
      <!-- <van-field
        label="问题级别"
        :value="problemData.problemLevel=='wtjb-yj'?'一级':problemData.problemLevel=='wtjb-ej'?'二级':'三级'"
        readonly
      /> -->
       <van-field
        label="问题级别"
        :value="problemData.problemLevel=='wtjb-yj'?'一级':problemData.problemLevel=='wtjb-ej'?'二级':'三级'"
        readonly
      />
      <van-field label="填报人" :value="problemData.sbrName" readonly />
      <van-field label="问题描述" autosize type="textarea" :value="problemData.content" readonly />
    </van-cell-group>
    <div class="timesline">
      <el-timeline>
        <el-timeline-item
          :color="index==0?'#0bbd87':'#409eff' "
          v-for="(activity, index) in activities"
          :key="index"
          :timestamp="activity.insertTime"
          placement="top"
        >
          <el-card>
            <div>{{ activity.clrId}}</div>
            <div>{{activity.fk}}</div>
          </el-card>
        </el-timeline-item>
        <!-- <el-timeline-item
							v-for="(activity, index) in activities"
							:key="index"
							:timestamp="activity.updateTime">
							{{ activity.clrId}}
							{{activity.fk}}
        </el-timeline-item>-->
      </el-timeline>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      problemData: {},
      activities: [],
      columns:[],
      wentileixin:''
    };
  },
  created() {
    this.issueTypeEvent();
  },
  methods: {
    issueTypeEvent() {
      this.$api
        .dictionary(
          { method: "post", type: "getDictionaryByCode" },
          { code: "wtlx" }
        )
        .then((res) => {
          console.log("问题类型", res);
          // this.columns = res.data.data[0].children
          res.data.data[0].children.forEach((x) => {
            this.columns.push({ text: x.name, id: x.id, code: x.code });
          });
          this.$api
            .problemBase(
              { method: "post", type: "get" },
              { id: this.$route.params.problemId }
            )
            .then((res) => {
              if (res.data.isSuccess) {
                console.log("get", res);
                this.problemData = res.data.data;
                var a = this.columns.filter(x=>x.code==this.problemData.type)
                console.log(a);
                this.wentileixin = a[0].text
              }
            });
          this.$api
            .disposalResults(
              { method: "post", type: "datagrid" },
              { problemId: this.$route.params.problemId }
            )
            .then((res) => {
              if (res.data.isSuccess) {
                this.activities = res.data.data;
              }
            });
        });
    },
  },
  computed: {
    companyName() {
      return this.$route.params.title;
    },
  },
};
</script>

<style scoped lang="less">
h3 {
  text-align: center;
}
.timesline {
  padding: 16px;
  background: #fff;
}
</style>
